-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Apply the "safe bool" idiom to ConfigureQueueStatus #590
base: main
Are you sure you want to change the base?
Conversation
39973d7
to
34c58c2
Compare
Signed-off-by: Vinay Deshmukh <[email protected]>
34c58c2
to
6f6d01c
Compare
I believe the test failures are not related. @hallfox want to take a quick look? |
// Use of an `UnspecifiedBool` to prevent implicit conversions to | ||
// integral values, and comparisons between different classes which | ||
// have boolean operators. | ||
typedef bsls::UnspecifiedBool<ConfigureQueueStatus>::BoolType BoolType; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type definition should be private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pretty much copied bmqa_closequestatus.h
's typedef from:
blazingmq/src/groups/bmq/bmqa/bmqa_closequeuestatus.h
Lines 78 to 87 in 346b9c3
public: | |
// TRAITS | |
BSLMF_NESTED_TRAIT_DECLARATION(CloseQueueStatus, bslma::UsesBslmaAllocator) | |
// TYPES | |
// Use of an `UnspecifiedBool` to prevent implicit conversions to | |
// integral values, and comparisons between different classes which | |
// have boolean operators. | |
typedef bsls::UnspecifiedBool<CloseQueueStatus>::BoolType BoolType; |
-
Should that be made private as well?
-
If the typedef becomes private, would the public
BoolType operator() const
even be usable to clients?
Issue number of the reported bug or feature request: #350
Describe your changes
Apply safe bool idiom
Testing performed
Describe the testing you have performed to ensure that the bug has been addressed, or that the new feature works as planned.
Assuming CI has existing tests for the component
Additional context
Add any other context about your contribution here.